import { $Enums } from '@prisma/client';
import { createZodDto } from 'nestjs-zod';
import { z } from 'zod';

export const UserCreateRequestSchema = z.object({
  name: z.string(),
  phone: z.string(),
  email: z.string().email(),
  password: z.string(),
  role: z.nativeEnum($Enums.Role).optional(),
});

export const UserCreateResponseSchema = z.object({
  accessToken: z.string(),
});

export type UserCreateRequest = z.infer<typeof UserCreateRequestSchema>;
export type UserCreateResponse = z.infer<typeof UserCreateResponseSchema>;

export class UserCreateDto extends createZodDto(UserCreateRequestSchema) {}
